/*
 * MessageQueue.h
 *
 *  Created on: 2012-12-18
 *      Author: yangentao@gmail.com
 */

#pragma once;
#include <list>
#include <boost/function.hpp>
#include "Message.h"
#include "AutoLock.h"
#include "Event.h"

using namespace std;
namespace yet {

class EmptyQueueException: public exception {

};

class MessageQueue: public ThreadLock {
	typedef list<Message> MyQueue;
public:
	MessageQueue();
	virtual ~MessageQueue();
public:
	void push_back(Message value);
	void push_front(Message value);
	Message pop_back();
	Message pop_front();
	void clear();
	bool isEmpty();
//	void quitWait();
//	bool waitMessage(Message& msg, DWORD milliSeconds);
private:
	MyQueue msgQueue;
//	Event event;
};


}
